<?php
 include('../php_includes.php');
	//require_once 'admin_options.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<!--Get data values of manager(an id) from submitted form in order to delete manager with no employees.
    If first manager is empty, then form was not submitted.Accessing the page by typing the url of the 
    page will prompt a error message, which will provide a link to return to page that let user to submit
    the form. Use query to delete employee where employee id equal manager id.
-->

  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="adminStyle.css"/>
	<script type="text/javascript" src="pwcheck.js">
	</script>
  </head>
  <body>
  
	<?php writeHeader(); ?>
        <?php  //Get data values
          $manager = $_POST["Managers"];
          $check = $_POST["hide"];
          if($check != "hidden")
          {
            echo "<p> Transaction invalid. </p>";
            echo "<p><a href='adminDeletion.php'>Go back to Admin Delete Manager</a></p>";
          }
          else
          {
            sqlConnect();
            $getId = "DELETE FROM Employee WHERE EmployeeID = '$manager';";
            $result = sqlQuery($getId);
            sqlExit();
            echo "<p> Your transaction was successfully. </p>";
            echo "<p><a href='adminDeletion.php'>Go back to Admin Delete Manager</a></p>";
          }
        ?>
</body>
</html>
	